package com.khh.mapper;

import com.khh.entity.User;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Select;

import java.util.List;

//@CacheNamespace  //由于生成的原因，一部分不是注解注解缓存有错，不能commit,建议配置
public interface UserMapper {

    /*自动生成方法*/
    int deleteByPrimaryKey(Integer uid);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer uid);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);



    //延时加载
    public User queryByIdLazy(int id);

    //手动添加  配置二级缓存
    public List<User> queryAll();

    //注解二级缓存
    @Select("select * from user")
    public List<User> queryAllByZhu();
}